/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package PropertyRental.war.servlets;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Bast
 */
class LogoutAction extends Action {

    public LogoutAction(String success, String fail){
        super(success, fail);
    }

    @Override
    public String perform(HttpServletRequest req) {
        HttpSession session = req.getSession();
        loginEJB.logout();
        synchronized(session) {
                session.setAttribute("account",null);
                session.invalidate();
            }
        return this.getSuccesspage();
    }



}
